using System;
using CodeAngel.Domain.Framework;

namespace CodeAngel.Domain
{
	public partial class User_RoleCollection
	{

        #region Find

        /// <summary>
        /// Find the User_Role entity for the identified role.  Null is returned if one is not
        /// found.
        /// </summary>
        public User_Role Find(Role thisRole)
        {
            foreach (User_Role ThisUserRole in this)
                if (ThisUserRole.Role.ID == thisRole.ID) return ThisUserRole;
            return null;
        }

        /// <summary>
        /// Find the User_Role entity for the identified role.  Null is returned if one is not
        /// found.
        /// </summary>
        public User_Role Find(User thisUser)
        {
            foreach (User_Role ThisUserRole in this)
                if (ThisUserRole.User.ID == thisUser.ID) return ThisUserRole;
            return null;
        }

        #endregion
	}
}

